{include file="/sum/common/script" /}

<div id="addEdit" class="faq-form" v-cloak>
    <el-container class="panel-block">
        <el-main>
            <el-scrollbar height="100%">
                <el-form :model="form.model" :rules="form.rules" ref="formRef" label-width="100px">
                    <el-form-item label="姓名" prop="name">
                        <el-input class="sa-w-360" v-model="form.model.name" placeholder="请输入姓名"></el-input>
                    </el-form-item>

                    <el-form-item label="头像" prop="avatar">
                        <sa-uploader v-model="form.model.avatar" type="size" @success="onSuccess"></sa-uploader>
                        <div class="warning"> 建议尺寸：320*320 px </div>
                    </el-form-item>

                    <el-form-item label="图片组" prop="images">
                        <sa-uploader v-model="form.model.images" :multiple="true"></sa-uploader>
                        <div class="warning">
                            图片组可以拖拽调整顺序
                        </div>
                    </el-form-item>

                    <el-form-item label="是否推荐">
                        <el-switch v-model="form.model.is_recommend" :active-value="1" :inactive-value="0"></el-switch>
                    </el-form-item>

                    <el-form-item label="虚拟人气值" prop="fake_popularity">
                        <el-input class="sa-w-360" v-model="form.model.fake_popularity" placeholder="请输入虚拟人气值" type="number" step="1">
                        </el-input>
                    </el-form-item>

                    <el-form-item label="虚拟粉丝数" prop="fake_followers">
                        <el-input class="sa-w-360" v-model="form.model.fake_followers" placeholder="请输入虚拟粉丝数" type="number" step="1">
                        </el-input>
                    </el-form-item>

                    <el-form-item label="标签" prop="tag">
                            <el-tag
                                    v-for="tag in form.model.tags"
                                    :key="tag"
                                    closable
                                    :disable-transitions="false"
                                    @close="handleClose(tag)"
                            >
                                {{ tag }}
                            </el-tag>
                            <el-input
                                    v-if="inputVisible"
                                    ref="InputRef"
                                    v-model="inputValue"
                                    style="width: 80px"
                                    size="small"
                                    @keyup.enter="handleInputConfirm"
                                    @blur="handleInputConfirm"
                            >
                            </el-input>
                            <el-button v-else class="button-new-tag" size="small" @click="showInput">
                                + 新标签
                            </el-button>
                    </el-form-item>

                    <el-form-item label="排序" prop="weigh">
                        <el-input class="sa-w-360" v-model="form.model.weigh" placeholder="请输入排序" type="number">
                        </el-input>
                        <div class="warning"> 排序的大小默认按照从大到小排列 </div>
                    </el-form-item>
                    <el-form-item label="状态" required>
                        <el-radio-group v-model="form.model.status">
                            <el-radio label="normal">正常</el-radio>
                            <el-radio label="hidden">隐藏</el-radio>
                        </el-radio-group>
                    </el-form-item>
                </el-form>
            </el-scrollbar>
        </el-main>
        <el-footer class="sa-footer--submit sa-flex sa-row-right">
            <el-button type="primary" @click="onConfirm">确定</el-button>
        </el-footer>
    </el-container>
</div>